﻿Admin.Posts = {};
Admin.Posts.CommentsDisabled = false;

Admin.Posts.Init = function () {
    $('#digestHelp').tooltip();

    $('#chkCommentsDisabled').click(function () {
        if ($(this).is(':checked')) {
            $(this).attr('value', 'True');
        } else {
            $(this).attr('value', 'False');
        }
    });

    //TODO: Método que retorna a lista string separado por virgula de todas as tags no importTags
    $('#inputTags').tagsInput({
        width: 'auto',
        defaultText: JsDictionary.Common.AddTag,
        removeWithBackspace: false
    }).importTags('a,s,d,q,w,e,r,t');

    $('div.scroll-pane').jScrollPane({ showArrows: false });

    tinyMCE.init({
        theme: "advanced",
        plugins: "autolink,lists,pagebreak,style,layer,table,advhr,advimage,advlink,preview,media,paste,fullscreen,visualchars,nonbreaking,xhtmlxtras,wordcount",
        mode: "exact",
        elements: "post",
        theme_advanced_buttons1: "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2: "pastetext,pasteword,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,|,forecolor,backcolor,|,sub,sup,|,charmap,media,advhr,|,fullscreen,|,preview,code",
        theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid",
        theme_advanced_toolbar_location: "top",
        theme_advanced_toolbar_align: "left",
        theme_advanced_statusbar_location: "bottom",
        skin: "o2k7",
        skin_variant: "silver",
        language: Admin.Common.Language,
        width: '100%'
    });

    tinyMCE.init({
        theme: "advanced",
        plugins: "autolink,maxchars,wordcount",
        mode: "exact",
        elements: "digest",
        theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,link,unlink",
        theme_advanced_toolbar_location: "top",
        theme_advanced_toolbar_align: "left",
        theme_advanced_statusbar_location: "bottom",
        skin: "o2k7",
        skin_variant: "silver",
        language: Admin.Common.Language,
        width: '100%',
        max_chars : 250,
        max_chars_indicator: "characterCounter",
        max_chars_text: JsDictionary.Common.Chars
    });
}